home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 May / Disc 1 / PCU0503CD1.iso / magstuff / program / files / quest312.exe / {app} / q3ext.qlb < prev    next >
Encoding:
Text File  |  2001-11-18  |  43.6 KB  |  1,091 lines

  1. !library
  2.  
  3. !asl-version <300>
  4.  
  5. ' N.B. THIS IS RELEASE 6 FOR QUEST 3.02 OR LATER
  6.  
  7. !addto game
  8.    command <examine in #q3ext.qlb.object#> do <q3ext.qlb.ExamProc>
  9.    command <examine #q3ext.qlb.object#> do <q3ext.qlb.ExamProc>
  10.    command <look in #q3ext.qlb.object#> do <q3ext.qlb.ExamProc>   
  11.    command <look at #q3ext.qlb.object#> do <q3ext.qlb.LookProc>
  12.    command <look #q3ext.qlb.object#> do <q3ext.qlb.LookProc>  
  13.    command <give #q3ext.qlb.give#> do <q3ext.qlb.GiveProc>
  14.    command <drop #q3ext.qlb.object# in #q3ext.qlb.container#> do <q3ext.qlb.PutInProc>
  15.    command <drop #q3ext.qlb.object#> exec <drop $q3ext.qlb.objname(#q3ext.qlb.object#)$;normal>
  16.    command <take #q3ext.qlb.object# from #q3ext.qlb.container#> do <q3ext.qlb.TakeBackProc>
  17.    command <take #q3ext.qlc.container#'s #q3ext.qlb.object#> do <q3ext.qlb.TakeBackProc>
  18.    command <take #q3ext.qlb.container#s #q3ext.qlb.object#> do <q3ext.qlb.TakeBackProc>
  19.    command <take #q3ext.qlb.container#' #q3ext.qlb.object#> do <q3ext.qlb.TakeBackProc>
  20.    command <take #q3ext.qlb.object#> do <q3ext.qlb.SpecialTakeProc>
  21.    command <read #q3ext.qlb.object#> do <q3ext.qlb.ReadProc>
  22.    command <wear #q3ext.qlb.object#> do <q3ext.qlb.WearProc>
  23.    command <unwear #q3ext.qlb.object#> do <q3ext.qlb.UnWearProc>
  24.    command <open #q3ext.qlb.object#> do <q3ext.qlb.OpenProc>
  25.    command <close #q3ext.qlb.object#> do <q3ext.qlb.CloseProc>
  26. !end
  27.  
  28. !addto synonyms
  29.    of; the =
  30.    x = examine
  31.    put; put down = drop
  32.    give back = give
  33.    pick up; pick; get; take back = take
  34.    out of; back from = from
  35.    in to; into; inside = in
  36.    back to = to
  37.    don; drop on = wear
  38.    take off; remove = unwear
  39.    shut = close
  40.    talk = speak
  41.    look at in = examine
  42.    go = go to
  43.    to to = to
  44. !end
  45.  
  46. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  47. '* This is a dummy room - only needed for the force_refresh procedure to function  *
  48. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  49.  
  50. define room <q3ext.qlb.limbo>
  51.    look <Just a dummy!>
  52. end define
  53.  
  54. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  55. '*    This procedure implements an alternative room description - optional usage   * 
  56. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  57.  
  58. define procedure <q3ext.qlb.DescribeRoomProc>
  59.    set string <q3ext.qlb.indescription;$gettag(#quest.currentroom#;indescription)$>
  60.    if is <#q3ext.qlb.indescription#;> then {
  61.       msg <|nYou are in $gettag(#quest.currentroom#;prefix)$ |b|cl#quest.currentroom#.|cb|xb|xn>
  62.    }
  63.    else {
  64.       msg <|n#q3ext.qlb.indescription#$gettag(#quest.currentroom#;prefix)$ |b|cl#quest.currentroom#.|cb|xb|xn>                
  65.    }
  66.    set string <q3ext.qlb.ObjList;>
  67.    set string <q3ext.qlb.CharList;>
  68.    for each object in <#quest.currentroom#> {
  69.       if property <#quest.thing#;invisible> or property <#quest.thing#;hidden> then {
  70.       }
  71.       else {
  72.          if property <#quest.thing#;human> then {
  73.             set <q3ext.qlb.CharList;#q3ext.qlb.CharList# |b#quest.thing#|xb, >
  74.          }
  75.          else{
  76.             set <q3ext.qlb.ObjList;#q3ext.qlb.ObjList# $objectproperty(#quest.thing#;prefix)$>
  77.             set <q3ext.qlb.ObjList;#q3ext.qlb.ObjList# |b#quest.thing#|xb, >
  78.          }
  79.       }
  80.    }
  81.    if ($lengthof(#q3ext.qlb.CharList#)$ >0) then {
  82.       set numeric <q3ext.qlb.LengthOf;$lengthof(#q3ext.qlb.CharList#)$ - 1>
  83.       set <q3ext.qlb.CharList;$left(#q3ext.qlb.CharList#;%q3ext.qlb.LengthOf%)$>
  84.       set <q3ext.qlb.CharList;$q3ext.qlb.parsed(#q3ext.qlb.CharList#)$>
  85.          if ($instr(#q3ext.qlb.CharList#;_and_)$ >0) then { 
  86.             msg < (#q3ext.qlb.CharList# are also here.)|xn>    
  87.          }
  88.          else {
  89.             msg < (#q3ext.qlb.CharList# is also here.)|xn>        
  90.          }
  91.       }
  92.       msg <|n|n$parameter(1)$|n>
  93.       if ($lengthof(#q3ext.qlb.ObjList#)$ >0) then {     
  94.          set <q3ext.qlb.LengthOf;$lengthof(#q3ext.qlb.ObjList#)$ - 1>
  95.          set <q3ext.qlb.ObjList;$left(#q3ext.qlb.ObjList#;%q3ext.qlb.LengthOf%)$>      
  96.          set <q3ext.qlb.ObjList;$q3ext.qlb.parsed(#q3ext.qlb.ObjList#)$>
  97.          if ($instr(#q3ext.qlb.ObjList#;_and_)$ >0) then { 
  98.             msg <There are #q3ext.qlb.ObjList# here.|n>     
  99.          }
  100.          else {
  101.             msg <There is #q3ext.qlb.ObjList# here.|n>         
  102.          }        
  103.       }
  104.       if not is <#quest.doorways.dirs#;> then {
  105.          msg <You can move #quest.doorways.dirs#.>
  106.       }
  107.       if not is <#quest.doorways.places#;> then {
  108.          msg <You can go to #quest.doorways.places#.>
  109.       }
  110.       if not is <#quest.doorways.out#;> then {
  111.          msg <You can go out to |b#quest.doorways.out.display#|xb.>
  112.       }     
  113. end define
  114.  
  115. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  116. '*  All regular 'take' commands are directed here to be tested for special needs   *
  117. '*  The code redirects to other procedures if object is in a container, and also   *
  118. '*  checks the player doesn't already have the item & prints message if he does.   *
  119. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  120.  
  121. define procedure <q3ext.qlb.SpecialTakeProc>
  122.    set string <q3ext.qlb.containedby;$q3ext.qlb.containedby$>  
  123.    if (#q3ext.qlb.containedby# = nil) then {
  124.       if got <#q3ext.qlb.object#> then {
  125.          msg <You already have the #q3ext.qlb.object#.>           
  126.       } 
  127.       else {
  128.          exec <take #q3ext.qlb.object#;normal>
  129.       }
  130.    }
  131.    else {
  132.       do <q3ext.qlb.TakeBackProc>
  133.    }
  134. end define
  135.  
  136. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  137. '*       This code is called if an object is taken that is in a container          * 
  138. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  139.  
  140. define procedure <q3ext.qlb.TakeBackProc>
  141.    set string <q3ext.qlb.containedby;$q3ext.qlb.containedby$>
  142.    if (#q3ext.qlb.containedby# = nil) then {
  143.       msg <(assuming you meant to take the #q3ext.qlb.object#).>
  144.       exec <take #q3ext.qlb.object#>
  145.    }
  146.    else {
  147.       if here <#q3ext.qlb.containedby#> or got <#q3ext.qlb.containedby#> then {
  148.          if not property <#q3ext.qlb.containedby#; closed> then {
  149.             move <#q3ext.qlb.object#;#quest.currentroom#>
  150.          }
  151.       }
  152.          outputoff
  153.          exec <take #q3ext.qlb.object#;normal>
  154.          outputoff
  155.          set string <q3ext.qlb.wherenow;#quest.currentroom#>
  156.          goto <q3ext.qlb.limbo>
  157.          goto <#q3ext.qlb.wherenow#>
  158.          outputon
  159.          if got <#q3ext.qlb.object#> then {
  160.             if property <#q3ext.qlb.containedby#;human> then {
  161.                msg <You take the #q3ext.qlb.object# from $capfirst(#q3ext.qlb.containedby#)$.>
  162.             }
  163.             else {
  164.                msg <You take the #q3ext.qlb.object# out of the #q3ext.qlb.containedby#.>
  165.             }
  166.          }
  167.       else {
  168.          exec <take #q3ext.qlb.object#;normal>
  169.       }
  170.    }
  171. end define
  172.  
  173. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  174. '*       Code called when an object is 'given to' or 'put into' a container        *
  175. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  176.  
  177. define procedure <q3ext.qlb.GiveProc>
  178.    set numeric <q3ext.qlb.ToPos;$instr(#q3ext.qlb.give#;_to_)$>
  179.    if (%q3ext.qlb.ToPos% <> 0) then {
  180.       set string <q3ext.qlb.GiveObj;$left(#q3ext.qlb.give#;%q3ext.qlb.ToPos%)$>
  181.       set string <q3ext.qlb.GiveObj;$q3ext.qlb.realname(#q3ext.qlb.Giveobj#)$>
  182.       set <q3ext.qlb.ToPos;%q3ext.qlb.ToPos% + 4>
  183.       set string <q3ext.qlb.GiveTo;$mid(#q3ext.qlb.give#;%q3ext.qlb.ToPos%)$>
  184.       set string <q3ext.qlb.GiveTo;$q3ext.qlb.realname(#q3ext.qlb.GiveTo#)$>      
  185.       if not property <#q3ext.qlb.GiveObj#; unworn> and action <#q3ext.qlb.GiveObj#;wear> then {
  186.          msg <You'll have to take $objectproperty(#q3ext.qlb.GiveObj#;pronoun)$ off first.>
  187.       }
  188.       else {
  189.          if here <#q3ext.qlb.GiveObj#> or got <#q3ext.qlb.GiveObj#> then {
  190.             if here <#q3ext.qlb.GiveTo#> or got <#q3ext.qlb.GiveTo#> then {
  191.                if property <#q3ext.qlb.GiveTo#;container> and not property <#q3ext.qlb.GiveTo#; closed> then {
  192.                   if got <#q3ext.qlb.GiveTo#> then {
  193.                      outputoff
  194.                      exec <drop #q3ext.qlb.GiveTo#>
  195.                      outputon
  196.                      exec <give #q3ext.qlb.GiveObj# to $q3ext.qlb.objname(#q3ext.qlb.GiveTo#)$; normal>
  197.                      outputoff
  198.                      exec <take #q3ext.qlb.GiveTo#>
  199.                      do <force_refresh>
  200.                      outputon
  201.                   }
  202.                   else {
  203.                      exec <give #q3ext.qlb.GiveObj# to $q3ext.qlb.objname(#q3ext.qlb.GiveTo#)$; normal>
  204.                      do <force_refresh>                  
  205.                   }
  206.                }
  207.                else {
  208.                   if property <#q3ext.qlb.GiveObj#;human > then {
  209.                      msg <You try, but $capfirst(#q3ext.qlb.GiveObj#)$ isn't interested.>
  210.                   }
  211.                   else {
  212.                      msg <Hard as you try, you find you cannot do that|xn>
  213.                      if property <#q3ext.qlb.GiveTo#; closed> then {
  214.                         msg < while the #q3ext.qlb.GiveTo# is closed.>
  215.                      }
  216.                      else {
  217.                         msg <.|n>
  218.                      }
  219.                   }
  220.                }
  221.             }
  222.             else {
  223.                if property <#q3ext.qlb.GiveTo#;human> then {
  224.                   msg <$capfirst(#q3ext.qlb.GiveObj#)$ isn't here.>
  225.                }
  226.                else {
  227.                   msg <The #q3ext.qlb.GiveTo# isn't available.>
  228.                }          
  229.             }
  230.          }
  231.          else {
  232.             if property <#q3ext.qlb.GiveObj#;human > then {
  233.                msg <$capfirst(#q3ext.qlb.GiveObj#)$ isn't here.>
  234.             }
  235.             else {
  236.                msg <The #q3ext.qlb.GiveObj# isn't available.>
  237.             }
  238.          }
  239.       }
  240.    }
  241.    else {
  242. '***  Deals with 'Give character the object' style. 
  243.       for <q3ext.qlb.SpaceTrue;1;$lengthof(#q3ext.qlb.give#)$> do <q3ext.qlb.SpaceTest>
  244.       set string <q3ext.qlb.GiveTo;$left(#q3ext.qlb.give#;%q3ext.qlb.FoundSpace%)$>
  245.       set string <q3ext.qlb.GiveObj;$mid(#q3ext.qlb.give#;%q3ext.qlb.FoundSpace%)$>
  246.       exec <give #q3ext.qlb.GiveObj# to #q3ext.qlb.GiveTo#>
  247.     }
  248. end define
  249.  
  250. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  251. '*   A utility procedure, called to find the positions of spaces in player input   *
  252. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  253.  
  254. define procedure <q3ext.qlb.SpaceTest>
  255.    set string <q3ext.qlb.Space;$mid(c o;2;1)$>
  256.    set string <q3ext.qlb.TestPart;$mid(#q3ext.qlb.give#;%q3ext.qlb.SpaceTrue%;1)$>
  257.    if is <#q3ext.qlb.space#;#q3ext.qlb.TestPart#> then set numeric <q3ext.qlb.FoundSpace;%q3ext.qlb.SpaceTrue%>
  258. end define
  259.  
  260. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  261. '*      This procedure deals with examining containers & objects in containers.    *
  262. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  263.  
  264. define procedure <q3ext.qlb.ExamProc>
  265.    set <q3ext.qlb.object; $q3ext.qlb.objname(#q3ext.qlb.object#)$>
  266.    set <q3ext.qlb.object; $q3ext.qlb.wornfix()$>
  267.    set string <q3ext.qlb.containedby;$q3ext.qlb.containedby$>
  268.    set string <q3ext.qlb.whereat;#quest.currentroom#>
  269.    if (#q3ext.qlb.containedby# = nil) then {
  270.       if action <#q3ext.qlb.object#; open> then {
  271.          if property <#q3ext.qlb.object#; closed> then {
  272.             if ($objectproperty(#q3ext.qlb.object#; closedexam)$ = null) then {
  273.                msg <Nothing out of the ordinary.>               
  274.             }
  275.             else {
  276.                msg <$objectproperty(#q3ext.qlb.object#; closedexam)$.>
  277.             }
  278.          }
  279.          else {
  280.             if ($objectproperty(#q3ext.qlb.object#; openexam)$ = null) then {
  281.                msg <Nothing out of the ordinary.>               
  282.             }
  283.             else {
  284.                msg <$objectproperty(#q3ext.qlb.object#; openexam)$.>
  285.             }
  286.          }
  287.       }
  288.       else {
  289.          exec <examine #q3ext.qlb.object#;normal>
  290.       }
  291.       if property <#q3ext.qlb.object#;container> then {
  292.          if here <#q3ext.qlb.object#> or got <#q3ext.qlb.object#> then {
  293.             doaction <#q3ext.qlb.object#;contents>
  294.          }
  295.       }
  296.    }
  297.    else {
  298.       if here <#q3ext.qlb.containedby#> or got <#q3ext.qlb.containedby#> then {
  299.          if not property <#q3ext.qlb.containedby#; closed> then {
  300.             outputoff
  301.             goto <#q3ext.qlb.containedby#_inventory>
  302.             outputon
  303.                if action <#q3ext.qlb.object#; open> then {
  304.                   if property <#q3ext.qlb.object#; closed> then {
  305.                      if ($objectproperty(#q3ext.qlb.object#; closedexam)$ = null) then {
  306.                         msg <Nothing out of the ordinary.>               
  307.                      }
  308.                      else {
  309.                         msg <$objectproperty(#q3ext.qlb.object#; closedexam)$.>
  310.                      }
  311.                   }
  312.                   else {
  313.                      if ($objectproperty(#q3ext.qlb.object#; openexam)$ = null) then {
  314.                         msg <Nothing out of the ordinary.>               
  315.                      }
  316.                      else {
  317.                         msg <$objectproperty(#q3ext.qlb.object#; openexam)$.>
  318.                      }
  319.                   }
  320.                }
  321.                else {
  322.                   exec <examine #q3ext.qlb.object#;normal>
  323.                }
  324.             outputoff
  325.             goto <#q3ext.qlb.whereat#>
  326.             outputon
  327.          }
  328.          else {
  329.             exec <examine #q3ext.qlb.object#;normal>
  330.          }
  331.       }
  332.       else {
  333.          exec <examine #q3ext.qlb.object#;normal>         
  334.       }
  335.    }
  336. end define
  337.  
  338. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  339. '*      This procedure deals with 'looking at' objects held in containers.         *
  340. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  341.  
  342. define procedure <q3ext.qlb.LookProc>
  343.    set <q3ext.qlb.object; $q3ext.qlb.realname(#q3ext.qlb.object#)$>
  344.    set <q3ext.qlb.object; $q3ext.qlb.wornfix()$>
  345.    set string <q3ext.qlb.containedby;$q3ext.qlb.containedby$>
  346.    set string <q3ext.qlb.whereat;#quest.currentroom#>
  347.    if (#q3ext.qlb.containedby# = nil) then {
  348.       exec <look at $q3ext.qlb.objname(#q3ext.qlb.object#)$;normal>
  349.    }
  350.    else {
  351.       if here <#q3ext.qlb.containedby#> or got <#q3ext.qlb.containedby#> then {
  352.          if not property <#q3ext.qlb.containedby#; closed> then {
  353.             outputoff
  354.             goto <#q3ext.qlb.containedby#_inventory>
  355.             outputon
  356.             exec <look at $q3ext.qlb.objname(#q3ext.qlb.object#)$;normal>   
  357.             outputoff
  358.             goto <#q3ext.qlb.whereat#>
  359.             outputon
  360.          }
  361.          else {
  362.             exec <look at $q3ext.qlb.objname(#q3ext.qlb.object#)$;normal>
  363.          }
  364.       }
  365.       else {
  366.          exec <look at $q3ext.qlb.objname(#q3ext.qlb.object#)$;normal>
  367.       }
  368.    }
  369. end define
  370.  
  371. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  372. '*   Redirects 'put into' so that it is processed by the 'give to' routine, these  *
  373. '*   are functionally identical so no need to have duplicate code                  *
  374. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  375.  
  376. define procedure <q3ext.qlb.PutInProc>
  377.    exec <give #q3ext.qlb.object# to #q3ext.qlb.container#>
  378. end define
  379.  
  380. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  381. '*  A utility procedure, returns the position of the last comma in a passed string *
  382. '*  Used to replace the last comma with 'and' when parsing output strings          *
  383. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  384.  
  385. define procedure <q3ext.qlb.LastCommaProc>
  386.    set string <q3ext.qlb.TestPart;$mid(#q3ext.qlb.Param#;%q3ext.qlb.LastComma%;1)$>
  387.    if is <#q3ext.qlb.TestPart#;,> then set <q3ext.qlb.FoundComma;%q3ext.qlb.LastComma%>
  388. end define
  389.  
  390. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  391. '*  The 'read' command procedure.                                                  *
  392. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  393.  
  394. define procedure <q3ext.qlb.ReadProc>
  395.    set <q3ext.qlb.object;$q3ext.qlb.realname(#q3ext.qlb.object#)$>
  396.    if property <#q3ext.qlb.object#;readable> then {
  397.       doaction <#q3ext.qlb.object#;read>
  398.       if not is <$objectproperty(#q3ext.qlb.object#;readaction)$; nil> then {
  399.          doaction <#q3ext.qlb.object#;readaction>
  400.       }
  401.    }
  402.    else {
  403.       msg <There's nothing to read!>
  404.    }
  405. end define
  406.  
  407.  
  408. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  409. '*  The 'wear' command procedure.                                                  *
  410. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  411.  
  412. define procedure <q3ext.qlb.WearProc>
  413.    set <q3ext.qlb.object;$q3ext.qlb.realname(#q3ext.qlb.object#)$>
  414.    msg <#q3ext.qlb.object#.....>
  415.    if got <#q3ext.qlb.object#> then {
  416.       if action <#q3ext.qlb.object#;wear> then {
  417.          if ($objectproperty(#q3ext.qlb.object#;sex)$ = %q3ext.qlb.playersex%) then {
  418.             do <q3ext.qlb.CheckWearProc>
  419.          }
  420.          else {
  421.             msg <On second thoughts you decide that the |xn>
  422.             msg <#q3ext.qlb.object# |xn>
  423.             if (%q3ext.qlb.playersex% = 1) then {
  424.                msg <won't suit a man like you at all.>
  425.             }
  426.             else {
  427.                msg <won't suit a woman like you at all.>
  428.             }
  429.          }
  430.          }
  431.          else {
  432.          msg <You cannot wear the #q3ext.qlb.object#.>
  433.          }
  434.    }
  435.    else {
  436.       msg <You are not carrying the #q3ext.qlb.object#.>
  437.    }
  438. end define
  439.  
  440. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  441. '*  The 'CheckWear' procedure - this checks the sense of wear commands             *
  442. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  443.  
  444. define procedure <q3ext.qlb.CheckWearProc>
  445.    set numeric <q3ext.qlb.wearable;0>
  446.    if ($objectproperty(#q3ext.qlb.object#;topcover)$ <> 0) and __
  447.    ($objectproperty(#q3ext.qlb.object#;topcover)$ <= %q3ext.qlb.topcovered%) then {
  448.       set <q3ext.qlb.wearable;%q3ext.qlb.wearable% + 1>
  449.    }
  450.    if ($objectproperty(#q3ext.qlb.object#;headcover)$ <> 0) and __
  451.    ($objectproperty(#q3ext.qlb.object#;headcover)$ <= %q3ext.qlb.headcovered%) then {
  452.       set <q3ext.qlb.wearable;%q3ext.qlb.wearable% + 1>
  453.    }
  454.    if ($objectproperty(#q3ext.qlb.object#;feetcover)$ <> 0) and __
  455.    ($objectproperty(#q3ext.qlb.object#;feetcover)$ <= %q3ext.qlb.feetcovered%) then {
  456.       set <q3ext.qlb.wearable;%q3ext.qlb.wearable% + 1>
  457.    }
  458.    if ($objectproperty(#q3ext.qlb.object#;handscover)$ <> 0) and __
  459.    ($objectproperty(#q3ext.qlb.object#;handscover)$ <= %q3ext.qlb.handscovered%) then {
  460.       set <q3ext.qlb.wearable;%q3ext.qlb.wearable% + 1>
  461.    }
  462. ' - disallow for coats (don't affect ability to put on lower torso clothes)
  463.    set <q3ext.qlb.tempcovered;%q3ext.qlb.botcovered%>
  464.    if (%q3ext.qlb.tempcovered% > 63) and __
  465.    ($objectproperty(#q3ext.qlb.object#;botcover)$ < 33) then {
  466.       set <q3ext.qlb.tempcovered;%q3ext.qlb.tempcovered% - 64>
  467.    }
  468. ' - disallow for skirts and dresses (like coats!)
  469.    if (%q3ext.qlb.tempcovered% > 31) and __
  470.    ($objectproperty(#q3ext.qlb.object#;botcover)$ < 16) and __
  471.    ($objectproperty(#q3ext.qlb.object#;botcover)$ <> 4) then {
  472.       set <q3ext.qlb.tempcovered;%q3ext.qlb.tempcovered% - 32>
  473.    }
  474. ' - disallow wearing of skirts/dresses and trousers simultaneously
  475.    if (%q3ext.qlb.tempcovered% > 15) then {
  476.       set <q3ext.qlb.tempcovered;%q3ext.qlb.tempcovered% + 16> 
  477.    }
  478.    if ($objectproperty(#q3ext.qlb.object#;botcover)$ <> 0) and __
  479.    ($objectproperty(#q3ext.qlb.object#;botcover)$ <= %q3ext.qlb.tempcovered%) then {
  480.       set <q3ext.qlb.wearable;%q3ext.qlb.wearable% + 1>
  481.    }
  482.    if (%q3ext.qlb.wearable% =0) then {
  483.       doaction <#q3ext.qlb.object#;wear>
  484.       property <#q3ext.qlb.object#; not unworn>
  485.       set <q3ext.qlb.topcovered;%q3ext.qlb.topcovered% + $objectproperty(#q3ext.qlb.object#;topcover)$>
  486.       set <q3ext.qlb.headcovered;%q3ext.qlb.headcovered% + $objectproperty(#q3ext.qlb.object#;headcover)$>
  487.       set <q3ext.qlb.handscovered;%q3ext.qlb.handscovered% + $objectproperty(#q3ext.qlb.object#;handscover)$>
  488.       set <q3ext.qlb.feetcovered;%q3ext.qlb.feetcovered% + $objectproperty(#q3ext.qlb.object#;feetcover)$>
  489.       set <q3ext.qlb.botcovered;%q3ext.qlb.botcovered% + $objectproperty(#q3ext.qlb.object#;botcover)$>
  490.    }
  491.    else {
  492.       msg <Given what you are already wearing - that makes no sense at all.>
  493.    }
  494. end define
  495.  
  496. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  497. '*  The 'unwear' command procedure.                                                *
  498. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  499.  
  500. define procedure <q3ext.qlb.UnWearProc>
  501.    set <q3ext.qlb.object;$q3ext.qlb.realname(#q3ext.qlb.object#)$>
  502.    if not property <#q3ext.qlb.object#; unworn> then {
  503.       if action <#q3ext.qlb.object#;unwear> then {
  504.          do <q3ext.qlb.CheckUnwearProc>
  505.       }
  506.       else {
  507.       msg <You cannot do that.>
  508.       }
  509.    }
  510.    else {
  511.       msg <You aren't wearing the #q3ext.qlb.object#.>
  512.    }
  513. end define
  514.  
  515. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  516. '*  The 'CheckUnwear' procedure.                                                   *
  517. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  518.  
  519. define procedure <q3ext.qlb.CheckUnwearProc>
  520.    set numeric <q3ext.qlb.wearable;0>
  521.    set <q3ext.qlb.tempcovered; %q3ext.qlb.topcovered% /2>
  522.    if ($objectproperty(#q3ext.qlb.object#;topcover)$ <> 0) and __
  523.    ($objectproperty(#q3ext.qlb.object#;topcover)$ <= %q3ext.qlb.tempcovered%) then {
  524.       set <q3ext.qlb.wearable;%q3ext.qlb.wearable% + 1>
  525.    }
  526.    set <q3ext.qlb.tempcovered; %q3ext.qlb.headcovered% /2>
  527.    if ($objectproperty(#q3ext.qlb.object#;headcover)$ <> 0) and __
  528.    ($objectproperty(#q3ext.qlb.object#;headcover)$ <= %q3ext.qlb.tempcovered%) then {
  529.       set <q3ext.qlb.wearable;%q3ext.qlb.wearable% + 2>
  530.    }
  531.    set <q3ext.qlb.tempcovered; %q3ext.qlb.feetcovered% /2>
  532.    if ($objectproperty(#q3ext.qlb.object#;feetcover)$ <> 0) and __
  533.    ($objectproperty(#q3ext.qlb.object#;feetcover)$ <= %q3ext.qlb.tempcovered%) then {
  534.       set <q3ext.qlb.wearable;%q3ext.qlb.wearable% + 4>
  535.    }
  536.    set <q3ext.qlb.tempcovered; %q3ext.qlb.handscovered% /2>   
  537.       if ($objectproperty(#q3ext.qlb.object#;handscover)$ <> 0) and __
  538.       ($objectproperty(#q3ext.qlb.object#;handscover)$ <= %q3ext.qlb.tempcovered%) then {
  539.          set <q3ext.qlb.wearable;%q3ext.qlb.wearable% + 8>
  540.    }
  541. ' - disallow for coats (don't affect ability to take off lower torso clothes)
  542.    set <q3ext.qlb.tempcovered;%q3ext.qlb.botcovered%>
  543.    if (%q3ext.qlb.tempcovered% > 63) then {
  544.       set <q3ext.qlb.tempcovered;%q3ext.qlb.tempcovered% - 64>
  545.    }
  546. ' - disallow for skirts and dresses (like coats!)
  547.    if (%q3ext.qlb.tempcovered% > 31) and __
  548.    ($objectproperty(#q3ext.qlb.object#;botcover)$ <> 4) then {
  549.       set <q3ext.qlb.tempcovered;%q3ext.qlb.tempcovered% - 32>
  550.    }
  551.    set <q3ext.qlb.tempcovered;%q3ext.qlb.tempcovered% /2>
  552.    if ($objectproperty(#q3ext.qlb.object#;botcover)$ <> 0) and __
  553.    ($objectproperty(#q3ext.qlb.object#;botcover)$ <= %q3ext.qlb.tempcovered%) then {
  554.       set <q3ext.qlb.wearable;%q3ext.qlb.wearable% + 16>
  555.    }
  556.    if (%q3ext.qlb.wearable% =0) then {
  557.       doaction <#q3ext.qlb.object#;unwear>
  558.       property <#q3ext.qlb.object#; unworn>
  559.       set <q3ext.qlb.topcovered;%q3ext.qlb.topcovered% - $objectproperty(#q3ext.qlb.object#;topcover)$>
  560.       set <q3ext.qlb.headcovered;%q3ext.qlb.headcovered% - $objectproperty(#q3ext.qlb.object#;headcover)$>
  561.       set <q3ext.qlb.handscovered;%q3ext.qlb.handscovered% - $objectproperty(#q3ext.qlb.object#;handscover)$>
  562.       set <q3ext.qlb.feetcovered;%q3ext.qlb.feetcovered% - $objectproperty(#q3ext.qlb.object#;feetcover)$>
  563.       set <q3ext.qlb.botcovered;%q3ext.qlb.botcovered% - $objectproperty(#q3ext.qlb.object#;botcover)$>
  564.    }
  565.    else {
  566.       msg <Given what you are wearing, that isn't possible.>
  567.    }
  568. end define
  569.  
  570. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  571. '* Open and close commands for 'openable' type                                     *
  572. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  573.  
  574. define procedure <q3ext.qlb.OpenProc>
  575.    set <q3ext.qlb.object; $q3ext.qlb.realname(#q3ext.qlb.object#)$>
  576.    if action <#q3ext.qlb.object#; open> then {
  577.       doaction <#q3ext.qlb.object#; open> 
  578.    }
  579.    else msg <You can't do that.>
  580. end define
  581.  
  582. define procedure <q3ext.qlb.CloseProc>
  583.    set <q3ext.qlb.object; $q3ext.qlb.realname(#q3ext.qlb.object#)$>
  584.    if action <#q3ext.qlb.object#; close> then {
  585.       doaction <#q3ext.qlb.object#; close>
  586.    }
  587.    else msg <You can't do that.>
  588. end define
  589.  
  590. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  591. '* This forces the inventory window to be refreshed - Quest doesn't do it itself!  *
  592. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  593.  
  594. define procedure <force_refresh>
  595.       outputoff
  596.       set string <q3ext.qlb.wherenow;#quest.currentroom#>
  597.       goto <q3ext.qlb.limbo>
  598.       goto <#q3ext.qlb.wherenow#>      
  599.       outputon
  600. end define
  601.  
  602. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  603. '* This is called to initialise the library                                        *
  604. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  605.  
  606. define procedure <q3ext.qlb.setup>
  607. '  These are defaults - making the player male and naked! - it will probably be 
  608. '  required to set these variables differently in the startscript AFTER calling
  609. '  this setup routine
  610. '  'q3ext.qlb.playersex' should be set to 1 for a male player, 2 for a female.
  611.    set numeric <q3ext.qlb.headcovered;0>
  612.    set numeric <q3ext.qlb.handscovered;0>
  613.    set numeric <q3ext.qlb.feetcovered;0>
  614.    set numeric <q3ext.qlb.topcovered;0>
  615.    set numeric <q3ext.qlb.botcovered;0>
  616.    set numeric <q3ext.qlb.tempcovered;0>
  617.    set numeric <q3ext.qlb.playersex;1>
  618.    set numeric <q3ext.qlb.version;6>
  619.    if (%q3ext.qlb.version% < $parameter(1)$) then {
  620.       msg <WARNING!|n|nThis game requires Version $parameter(1)$ (or later) of _
  621.       the Q3EXT.QLB library, you appear to have Version %q3ext.qlb.version%. _
  622.       |n|nPlease obtain the latest release of the library before trying to run this _
  623.       game.|n|n|w>
  624.    }
  625. end define
  626.  
  627. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  628. '*                         FUNCTION DEFINITIONS FOLLOW                             *
  629. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  630.  
  631. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  632. '* Returns passed string that was comma separated list 'parsed' to read naturally. *
  633. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  634.  
  635. define function <q3ext.qlb.parsed>
  636.    set numeric <q3ext.qlb.FoundComma;0>
  637.    set string <q3ext.qlb.Param;$parameter(1)$>
  638.    for <q3ext.qlb.LastComma;1;$lengthof(#q3ext.qlb.Param#)$> {
  639.    do <q3ext.qlb.LastCommaProc>
  640.    }
  641.       if not is <%q3ext.qlb.FoundComma%;0> then { 
  642.       set numeric <q3ext.qlb.remaining;%q3ext.qlb.LastComma%-%q3ext.qlb.FoundComma%>
  643.       set <q3ext.qlb.remaining;%q3ext.qlb.remaining%-1>
  644.       set <q3ext.qlb.FoundComma;%q3ext.qlb.FoundComma%-1>
  645.       set string <q3ext.qlb.LeftPart;$left(#q3ext.qlb.Param#;__
  646.       %q3ext.qlb.FoundComma%)$>
  647.       set string <q3ext.qlb.RightPart;$right(#q3ext.qlb.Param#;__
  648.       %q3ext.qlb.remaining%)$>
  649.       set string <q3ext.qlb.parsed;#q3ext.qlb.LeftPart# and #q3ext.qlb.RightPart#>
  650.       }
  651.       if is <%q3ext.qlb.FoundComma%;0> then {
  652.       set string <q3ext.qlb.parsed;#q3ext.qlb.Param#>
  653.       }
  654.       return <#q3ext.qlb.parsed#>
  655. end define
  656.  
  657. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  658. '* The following function returns the name of the object in who's container the    *
  659. '* looked at object is held, or 'nil' if the object isn't in a container.          *
  660. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  661.  
  662. define function <q3ext.qlb.containedby>
  663.    set <q3ext.qlb.object; $q3ext.qlb.realname(#q3ext.qlb.object#)$>
  664.    set string <q3ext.qlb.containedby;$locationof(#q3ext.qlb.object#)$>
  665.    set numeric <q3ext.qlb.LengthOf;$lengthof(#q3ext.qlb.containedby#)$>
  666.    if (%q3ext.qlb.LengthOf% < 11) then {
  667.       set <q3ext.qlb.containedby;nil>
  668.    }
  669.    if (%q3ext.qlb.LengthOf% > 11) then {
  670.       set <q3ext.qlb.containedby;$right(#q3ext.qlb.containedby#;10)$>
  671.    }
  672.    if (#q3ext.qlb.containedby# <> _inventory) then {
  673.       set <q3ext.qlb.containedby;nil>
  674.    }
  675.    if (#q3ext.qlb.containedby# = _inventory) then {
  676.       set <q3ext.qlb.containedby;$locationof(#q3ext.qlb.object#)$>
  677.       set <q3ext.qlb.LengthOf;%q3ext.qlb.LengthOf%-10>
  678.       set <q3ext.qlb.containedby;$left(#q3ext.qlb.containedby#;%q3ext.qlb.LengthOf%)$>    
  679.    }
  680.    return <#q3ext.qlb.containedby#>
  681. end define
  682.  
  683. define function <q3ext.qlb.wornfix>
  684.    set string <q3ext.qlb.wornfix;#q3ext.qlb.object#>
  685.    if action <#q3ext.qlb.object#; wear> and not property <#q3ext.qlb.object#; unworn> then {
  686.       set <q3ext.qlb.wornfix;#q3ext.qlb.object# [worn]>
  687.    }
  688.    return <#q3ext.qlb.wornfix#>
  689. end define
  690.  
  691. define function <q3ext.qlb.objname>
  692.       set string <q3ext.qlb.objname;$parameter(1)$>
  693.       set <q3ext.qlb.objname;$q3ext.qlb.realname(#q3ext.qlb.objname#)$>      
  694.       set <q3ext.qlb.objname;$displayname(#q3ext.qlb.objname#)$>
  695.       return <#q3ext.qlb.objname#>
  696. end define
  697.  
  698. define function <q3ext.qlb.realname>
  699.       set numeric <q3ext.qlb.found;0>
  700.       set string <q3ext.qlb.objname;$parameter(1)$>
  701.       set string <q3ext.qlb.lobjname;$lcase(#q3ext.qlb.objname#)$>
  702.  
  703.       for each object in <#quest.currentroom#> {
  704.          set string <q3ext.qlb.display;$displayname(#quest.thing#)$>
  705.          set string <q3ext.qlb.display;$lcase(#q3ext.qlb.display#)$>
  706.          set string <q3ext.qlb.realname;#quest.thing#>
  707.          set string <q3ext.qlb.realname;$lcase(#q3ext.qlb.realname#)$>
  708.          if ( $instr(#q3ext.qlb.display#;#q3ext.qlb.lobjname#)$ > 0 ) or _
  709.             ( $instr(#q3ext.qlb.lobjname#;#q3ext.qlb.realname#)$ > 0 ) then {  
  710.              set <q3ext.qlb.objname;#quest.thing#>
  711.              set <q3ext.qlb.found;1>
  712.          }    
  713.       }
  714.       if (%q3ext.qlb.found% = 0) then {
  715.          for each object in inventory {
  716.          set string <q3ext.qlb.display;$displayname(#quest.thing#)$>
  717.          set string <q3ext.qlb.display;$lcase(#q3ext.qlb.display#)$>
  718.          set string <q3ext.qlb.realname;#quest.thing#>
  719.          set string <q3ext.qlb.realname;$lcase(#q3ext.qlb.realname#)$>
  720.             if ( $instr(#q3ext.qlb.display#;#q3ext.qlb.lobjname#)$ > 0 ) or _
  721.                ( $instr(#q3ext.qlb.lobjname#;#q3ext.qlb.realname#)$ > 0 ) then {  
  722.                set <q3ext.qlb.objname;#quest.thing#>      
  723.                set <q3ext.qlb.found;1>
  724.             }    
  725.          }     
  726.       }
  727.        if (%q3ext.qlb.found% = 0) then {
  728.          for each object in game {
  729.          set string <q3ext.qlb.display;$displayname(#quest.thing#)$>
  730.          set string <q3ext.qlb.display;$lcase(#q3ext.qlb.display#)$>
  731.          set string <q3ext.qlb.realname;#quest.thing#>
  732.          set string <q3ext.qlb.realname;$lcase(#q3ext.qlb.realname#)$>
  733.             if ( $instr(#q3ext.qlb.display#;#q3ext.qlb.lobjname#)$ > 0 ) or _
  734.                ( $instr(#q3ext.qlb.lobjname#;#q3ext.qlb.realname#)$ > 0 ) then {  
  735.                 set <q3ext.qlb.objname;#quest.thing#>      
  736.             }    
  737.          }     
  738.       }     
  739.    return <#q3ext.qlb.objname#>
  740. end define
  741.  
  742.  
  743. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  744. '*                           TYPE DEFINITIONS FOLLOW                               *
  745. '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  746.  
  747. define type <human>
  748.    human
  749.    type <container>
  750.    displaytype=Person
  751.    action <take> {
  752.       set string <q3ext.qlb.object; $mid(#quest.command#;6)$>
  753.       msg <You can't take $capfirst(#q3ext.qlb.object#)$!>
  754.    }
  755.    action <speak> {
  756.       set string <q3ext.qlb.object; $mid(#quest.command#;10)$>
  757.       msg <$capfirst(#q3ext.qlb.object#)$ doesn't reply to you.>
  758.    }
  759.       action <give anything> {
  760.          if property <#q3ext.qlb.GiveTo#;container> then {
  761.          msg <|n$capfirst(#q3ext.qlb.GiveTo#)$ accepts the #q3ext.qlb.GiveObj#.>
  762.          move <#q3ext.qlb.GiveObj#;#q3ext.qlb.GiveTo#_inventory>
  763.          }
  764.          else {
  765.          msg <$capfirst(#q3ext.qlb.GiveTo#)$ doesn't seem to want the #q3ext.qlb.GiveObj#.>
  766.          }
  767.    }
  768. end define
  769.  
  770. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  771.  
  772. define type <container>
  773.    container
  774.    action <contents> {
  775.       if not property <#q3ext.qlb.object#; closed> then {
  776.          outputoff
  777.          goto <#q3ext.qlb.object#_inventory>
  778.          set string <q3ext.qlb.whatsheld;$gettag(#q3ext.qlb.object#_inventory;prefix)$$q3ext.qlb.parsed(#quest.formatobjects#)$.>
  779.          if ($lengthof(#quest.objects#)$ = 0) then set <q3ext.qlb.whatsheld;>
  780.          outputon
  781.          msg <#q3ext.qlb.whatsheld#>         
  782.          outputoff
  783.          goto <#q3ext.qlb.whereat#>
  784.          outputon
  785.       }
  786.    }
  787.  
  788.    action <give anything> {
  789.       msg <You put the #q3ext.qlb.GiveObj# in the #q3ext.qlb.GiveTo#.>
  790.       move <#q3ext.qlb.GiveObj#; #q3ext.qlb.GiveTo#_inventory>
  791.    }
  792. end define
  793.  
  794. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  795.  
  796. define type <object>
  797.       prefix = a
  798.       take = nil
  799.       action <take> {
  800.          if ($objectproperty(#q3ext.qlb.object#;take)$=nil) then {
  801.             msg <You pick up the #q3ext.qlb.object#.>
  802.          }
  803.          else {
  804.          msg <$objectproperty(#q3ext.qlb.object#;take)$.>      
  805.          }     
  806.       move <#q3ext.qlb.object#;inventory>
  807.       do <force_refresh>
  808.       }
  809. end define
  810.  
  811. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  812.  
  813. define type <scenery>
  814.    invisible
  815.    prefix = a
  816.    pronoun = that
  817.    notake = nil
  818.    action <take> {
  819.       if ($objectproperty(#q3ext.qlb.object#;notake)$=nil) then {
  820.       msg <Taking $objectproperty(#q3ext.qlb.object#;pronoun)$ would serve no useful purpose.>
  821.       }
  822.       else {
  823.       msg <$objectproperty(#q3ext.qlb.object#;notake)$.>    
  824.       }
  825.    }
  826. end define
  827.  
  828. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  829.  
  830. define type <readable>
  831.    readable
  832.    readmessage = You start to read but it is so incredibly dull you decide not to bother.
  833.    readaction = nil
  834.    action <read> {
  835.    set string <q3ext.qlb.objname;$thisobject$>
  836.    msg <$objectproperty(#q3ext.qlb.objname#;readmessage)$>
  837.    }
  838. end define
  839.  
  840. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  841. ' *  The openable type                                                              *
  842. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  843.  
  844. define type <openable>
  845.    closed
  846.    properties <closeddesc = null>
  847.    properties <opendesc = null>
  848.    properties <closingdesc = null>
  849.    properties <openingdesc = null>
  850.    properties <closedexam = null>
  851.    properties <openexam = null>  
  852.    
  853.    prefix = a
  854.      
  855.    action <open> {
  856.    set string <q3ext.qlb.opened; $thisobject$>   
  857.    if property <$thisobject$; closed> then {
  858.       property <$thisobject$; not closed>
  859.       if ($objectproperty(#q3ext.qlb.opened#; openingdesc)$ = null) then {
  860.          msg <You open the #q3ext.qlb.object#.>
  861.       }
  862.       else {
  863.          msg <$objectproperty(#q3ext.qlb.opened#; openingdesc)$>
  864.       }
  865.    }
  866.    else msg <The #q3ext.qlb.object# is already open.>
  867.    }
  868.     
  869.    action <close> {
  870.    set string <q3ext.qlb.closed; $thisobject$>    
  871.    if not property <$thisobject$;closed> then {
  872.       property <$thisobject$; closed>
  873.       if ($objectproperty(#q3ext.qlb.closed#; closingdesc)$ = null) then {
  874.          msg <You close the #q3ext.qlb.object#.>
  875.       }
  876.       else {
  877.          msg <$objectproperty(#q3ext.qlb.closed#; closingdesc)$.>      
  878.       }
  879.    }
  880.    else msg <The #q3ext.qlb.object# is already closed.>
  881.    }
  882.     
  883.    action <look> {
  884.    set string <q3ext.qlb.lookedat; $thisobject$>
  885.    if property <$thisobject$; closed> then {
  886.       if ($objectproperty(#q3ext.qlb.lookedat#; closeddesc)$ = null) then {
  887.          set string <q3ext.qlb.lookmessage ;The #q3ext.qlb.lookedat# is closed>
  888.       }
  889.       else {
  890.          set string <q3ext.qlb.lookmessage ;$objectproperty(#q3ext.qlb.lookedat#; closeddesc)$.>
  891.       }
  892.    }
  893.    else {
  894.       if ($objectproperty(#q3ext.qlb.lookedat#; opendesc)$ = null) then {
  895.          set string <q3ext.qlb.lookmessage ;The #q3ext.qlb.lookedat# is open>
  896.       }
  897.       else {
  898.          set string <q3ext.qlb.lookmessage ;$objectproperty(#q3ext.qlb.lookedat#; opendesc)$.>
  899.       }
  900.    }
  901.    msg <#q3ext.qlb.lookmessage#.>
  902.    }
  903.    
  904. end define
  905.  
  906. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  907. ' * This clothing type is not used directly but inherited by specific clothes.      *
  908. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  909.  
  910. define type <clothing>
  911.    type <object>
  912.    unworn
  913.    headcover = 0
  914.    handscover = 0
  915.    feetcover = 0
  916.    topcover = 0
  917.    botcover = 0
  918.    sex = 1
  919.    pronoun = it
  920.    wearmessage = You put it on.
  921.    unwearmessage = You take it off.
  922.    properties <alias=$thisobject$>
  923.       action <wear> {
  924.       set string <q3ext.qlb.objname;$thisobject$>
  925.       msg <$objectproperty(#q3ext.qlb.objname#;wearmessage)$>
  926.       property <#q3ext.qlb.objname#;alias=#q3ext.qlb.objname# [worn]>
  927.       move <#q3ext.qlb.objname#;inventory>
  928.       do <force_refresh>
  929.       }
  930.       action <unwear> {
  931.       set string <q3ext.qlb.objname;$thisobject$>
  932.       msg <$objectproperty(#q3ext.qlb.objname#;unwearmessage)$>
  933.       property <#q3ext.qlb.objname#;alias=$thisobject$>
  934.       do <force_refresh>
  935.       }   
  936. end define  
  937.  
  938. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  939. ' * This lib defines 15 specific clothing objects, and most of these can be used    *
  940. ' * to good effect for other garments - the defined objects are listed together     *
  941. ' * with other garments that work similarly for game purposes.                      *
  942. ' *                                                                                 *
  943. ' * DEFINED GARMENT : ALSO USABLE FOR THESE GARMENTS                                *
  944. ' * hat             : any headwear                                                  *
  945. ' * gloves          : any handwear                                                  *
  946. ' * shoes           : boots, outer footwear generally                               *
  947. ' * socks           : stockings                                                     *
  948. ' * tights          : pantie hose                                                   *
  949. ' * undies          : panties, briefs - lower portion underwear generally           *
  950. ' * teddy           : uhm.. any underthing that covers like a teddy!                *
  951. ' * trousers        : jeans, shorts (not the underwear variety)                     *
  952. ' * dress           : coverall                                                      *
  953. ' * skirt           : kilt maybe?                                                   *
  954. ' * vest            : bra, other 'top only' undergarment                            *
  955. ' * shirt           : blouse, T-Shirt etc.                                          *
  956. ' * sweater         : pullover, sweatshirt - '2nd layer' top garment                *
  957. ' * jacket          : fleece, parka, anorak, short coat of whatever type            *
  958. ' * coat            : any long length outermost garment like a coat                 *
  959. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  960.  
  961. define type <shoes>
  962.       type <clothing>
  963.       feetcover = 4
  964.       wearmessage = You put them on.
  965.       unwearmessage = You take them off.
  966.       pronoun = them
  967.    properties <prefix=a pair of>
  968. end define
  969.  
  970. define type <socks>
  971.       type <clothing>
  972.       feetcover = 2
  973.       wearmessage = You put them on.
  974.       unwearmessage = You take them off.
  975.       pronoun = them
  976.    properties <prefix=a pair of>
  977. end define
  978.  
  979. define type <tights>
  980.       type <clothing>
  981.       feetcover = 2
  982.       botcover = 8
  983.       pronoun = them
  984.       wearmessage = You put them on.
  985.       unwearmessage = You take them off.
  986.    properties <prefix=a pair of>
  987. end define
  988.  
  989. define type <hat>
  990.       type <clothing>
  991.       headcover = 2
  992.       wearmessage = You put it on.
  993.       unwearmessage = You take it off.
  994.    properties <prefix=a>
  995. end define
  996.  
  997. define type <gloves>
  998.       type <clothing>
  999.       handscover = 2
  1000.       wearmessage = You put them on.
  1001.       unwearmessage = You take them off.
  1002.       pronoun = them
  1003.  properties <prefix=a pair of>
  1004. end define
  1005.  
  1006. define type <vest>
  1007.       type <clothing>
  1008.       topcover = 2
  1009.       wearmessage = You put it on.
  1010.       unwearmessage = You take it off.
  1011.    properties <prefix=a>
  1012. end define
  1013.  
  1014. define type <shirt>
  1015.       type <clothing>
  1016.       topcover = 8
  1017.       wearmessage = You put it on.
  1018.       unwearmessage = You take it off.
  1019.    properties <prefix=a>
  1020. end define
  1021.  
  1022. define type <teddy>
  1023.       type <clothing>
  1024.       topcover = 4
  1025.       botcover = 4
  1026.       wearmessage = You put it on.
  1027.       unwearmessage = You take it off.
  1028.    properties <prefix=a>
  1029. end define
  1030.  
  1031. define type <undies>
  1032.       type <clothing>
  1033.       botcover = 2
  1034.       wearmessage = You put them on.
  1035.       unwearmessage = You take them off.
  1036.       pronoun = them
  1037.    properties <prefix=a pair of>
  1038. end define
  1039.  
  1040. define type <dress>
  1041.       type <clothing>
  1042.       topcover = 8
  1043.       botcover = 32
  1044.       wearmessage = You put it on.
  1045.       unwearmessage = You take it off.
  1046.    properties <prefix=a>
  1047. end define
  1048.  
  1049. define type <skirt>
  1050.       type <clothing>
  1051.       botcover = 32
  1052.       wearmessage = You put it on.
  1053.       unwearmessage = You take it off.
  1054.    properties <prefix=a>
  1055. end define
  1056.  
  1057. define type <trousers>
  1058.       type <clothing>
  1059.       botcover = 16
  1060.       wearmessage = You put them on.
  1061.       unwearmessage = You take them off.
  1062.       pronoun = them
  1063.    properties <prefix=a pair of>
  1064. end define
  1065.  
  1066. define type <sweater>
  1067.       type <clothing>
  1068.       topcover = 16
  1069.       wearmessage = You put it on.
  1070.       unwearmessage = You take it off.
  1071.    properties <prefix=a>
  1072. end define
  1073.  
  1074. define type <jacket>
  1075.       type <clothing>
  1076.       topcover = 32
  1077.       wearmessage = You put it on.
  1078.       unwearmessage = You take it off.
  1079.    properties <prefix=a>
  1080. end define
  1081.  
  1082. define type <coat>
  1083.       type <clothing>
  1084.       topcover = 64
  1085.       botcover = 64
  1086.       wearmessage = You put it on.
  1087.       unwearmessage = You take it off.
  1088.    properties <prefix=a>
  1089. end define
  1090.  
  1091. ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *